package vista;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTable;
import javax.swing.JToggleButton;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ReporteVentas extends javax.swing.JFrame {
	private JLabel jLabel1;
	private JLabel jLabel2;
	private JScrollPane jScrollPane1;
	private JButton btnDescendente;
	private JSeparator jSeparator1;
	private JComboBox cmbOrdenar;
	private JTable tblReporteVentas;
	private JButton btnSalir;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public ReporteVentas(){
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			getContentPane().setBackground(new java.awt.Color(0,0,0));
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("REPORTE DE VENTA DE PRODUCTOS");
				jLabel1.setBounds(179, 12, 440, 24);
				jLabel1.setFont(new java.awt.Font("Purisa",1,14));
				jLabel1.setForeground(new java.awt.Color(255,255,255));
			}
			{
				btnSalir = new JButton();
				getContentPane().add(btnSalir);
				btnSalir.setBounds(647, 283, 25, 27);
				btnSalir.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/salir.jpg")));
				btnSalir.setOpaque(false);
				btnSalir.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
				btnSalir.setActionCommand("Salir");
			}
			{
				jLabel2 = new JLabel();
				getContentPane().add(jLabel2);
				jLabel2.setText("Ordenar Por: ");
				jLabel2.setFont(new java.awt.Font("Purisa",1,14));
				jLabel2.setForeground(new java.awt.Color(255,255,255));
				jLabel2.setBounds(17, 42, 133, 24);
			}
			{
				jScrollPane1 = new JScrollPane();
				getContentPane().add(jScrollPane1);
				jScrollPane1.setBounds(35, 83, 601, 200);
				{
					tblReporteVentas = new JTable();
					jScrollPane1.setViewportView(tblReporteVentas);
				}
			}
			{
				cmbOrdenar = new JComboBox();
				getContentPane().add(cmbOrdenar);
				cmbOrdenar.setBounds(135, 42, 198, 22);
			}
			{
				btnDescendente = new JButton();
				getContentPane().add(btnDescendente);
				btnDescendente.setText("Asc/Desc");
				btnDescendente.setActionCommand("Descendente");
				btnDescendente.setFont(new java.awt.Font("Purisa",0,10));
				btnDescendente.setBackground(new java.awt.Color(255,255,255));
				btnDescendente.setBounds(359, 42, 103, 23);
			}
			{
				jSeparator1 = new JSeparator();
				getContentPane().add(jSeparator1);
				jSeparator1.setBounds(172, 32, 311, 10);
			}
			pack();
			this.setSize(686, 352);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public void addListener(ActionListener actionListener){
		this.cmbOrdenar.addActionListener(actionListener);
		this.btnSalir.addActionListener(actionListener);
		this.btnDescendente.addActionListener(actionListener);
	}
	public void setComboOrdenar(String[] formas){
		ComboBoxModel cmbComboOrdenarModel = new DefaultComboBoxModel(formas);
		this.cmbOrdenar.setModel(cmbComboOrdenarModel);
	}
	public String getComboOrdenar(){
		return this.cmbOrdenar.getSelectedItem().toString();
	}
	public void setTabReportes(AbstractTableModel abstracTableModel){
		this.tblReporteVentas.setModel(abstracTableModel);
	}
}
